#pragma once
#include"AbstractLayer.h"

class DemoQueryAABB : public AbstractLayer, public b2QueryCallback
{
public:
	createScene(DemoQueryAABB)

	CREATE_FUNC(DemoQueryAABB)
	
	bool init();

	virtual void box2DAppReady() override;

	void createBodies();

	void drawAABB(b2Color color);

	virtual bool ReportFixture(b2Fixture* fixture);

	virtual void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *unused_event) override;
	
	virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
private:
	int unRemoveable;
	b2Vec2 mousePoint;
	b2Color color = b2Color(1, 0, 0);
	b2AABB ab;
	float abSize = 5 * 0.03125;
};